<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>发布商品</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" href="<%=basePath%>css/addGoods.css"
	type="text/css">
<link rel="stylesheet" href="<%=basePath%>css/addGoods2.css"
	type="text/css">
<link rel="stylesheet" href="<%=basePath%>css/addGoods3.css"
	type="text/css">

<script>
    (function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
    </script>

</head>

<body>
	<form action="goods/addGoods.do" method="post"
		enctype="multipart/form-data">
		<div class="main center">
			<div class="wave-fluid"></div>
			<div class="release-title">发布商品</div>
			<div class="upload-wr">
				<div class="clone-target">
					<div class="photo">
						<div>
							<img src="" alt="" class="image">
						</div>
						<span class="close"></span>
					</div>
				</div>
				<div class="form-key">
					<span>最少一张，最多上传5张图片，支持jpg、png、gif格式</span>
				</div>
				<input type="file" name="images" accept="image/*"> <input
					type="file" name="images" accept="image/*"> <input
					type="file" name="images" accept="image/*"> <input
					type="file" name="images" accept="image/*"> <input
					type="file" name="images" accept="image/*">

			</div>

			<div class="form-wr">
				<div class="form-must-wr">
					<div class="form-item l goods-title">
						<div class="form-key">
							<span>商品名称</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr">
								<input type="text" id="title" name="title" placeholder="最多25个字">
							</div>
						</div>
					</div>

					<div class="form-item m goods-price">
						<div class="form-key">
							<span>价格</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr"
								style="border: 1px solid rgb(208, 224, 226); background-color: rgb(246, 249, 249);">
								<input class="price" type="text" id="price" name="price">
							</div>
						</div>
					</div>
					<div class="form-item m goods-price">
						<div class="form-key">
							<span>库存</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr"
								style="border: 1px solid rgb(208, 224, 226); background-color: rgb(246, 249, 249);">
								<input class="price" type="text" id="stock" name="stock">
							</div>
						</div>
					</div>
					<div class="form-item l goods-title">
						<div class="form-key">
							<span>新旧程度(**成新)</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr">
								<input type="text" id="degree" name="degree"
									placeholder="如填写9.3，8.5，7,10即全新">
							</div>
						</div>
					</div>
					<div class="form-item xl goods-desc">
						<div class="form-key">
							<span>商品详情</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr"
								style="border: 1px solid rgb(208, 224, 226); background-color: rgb(246, 249, 249);">
								<textarea name="desc" id="desc"
									placeholder="建议填写物品用途、详细描述等信息，至少15个字"></textarea>
							</div>
						</div>
					</div>
					<div class="form-item m goods-discount">
						<div class="form-key">
							<span>交易方式</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr">
								<select name="transactionMode" class="yes sel" onchange="cla()">
									<option value="-1">请选择</option>
									<option value="true" class="yes sel">在线交易</option>
									<option value="false" class="no">线下交易</option>
								</select>
								<!--  
                            <span class="yes sel" data-value="1">在线交易</span>
                            <span class="no" data-value="0">线下交易</span>
                           -->
							</div>
						</div>
					</div>

					<div class="form-item l goods-title">
						<div class="form-key">
							<span>交易地点</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr">
								<input type="text" id="trade_place" name="trade_place"
									placeholder="宿舍、教学楼、图书馆等" value="">
							</div>
						</div>
					</div>


					<div class="form-item m goods-cat">
						<div class="form-key">
							<span>分类</span>
						</div>
						<div class="form-value">
							<div class="form-input-wr">
								<span>请选择</span> <input type="hidden" id="cat" name="cat"
									value="">
							</div>
							<ul class="select">
								<c:forEach items="${largeCategories }" var = "largeCat">
									<li pk="item${largeCat.getId() }" value="${largeCat.getId() }"><span>${largeCat.getName() }</span>
									</li>
								</c:forEach>
								
							</ul>
						</div>
						<div class="form-value-l hide">
							<div class="form-input-l-wr">
								<span>请选择</span> <input type="hidden" id="cat_l" name="cat_l"
									value="">
							</div>
							<ul class="select hide">
								<c:forEach items="${smallCategoriesMap }" var = "entry">
									<c:forEach items="${entry.value }" var = "smallCat">
										<li class="item${smallCat.getParentId() } hide" value="${smallCat.getId() }">
										<span>${smallCat.getName() }</span>
										</li>
									</c:forEach>>
								</c:forEach>
							</ul>
						</div>
					</div>

				</div>

				<div class="form-share-wr">
					<label for="form-share"> <input id="form-share"
						name="share" type="checkbox" checked="on"> <span>我同意&nbsp;<a
							href="" target="_blank">商品发布规则</a>
					</span> </label>
				</div>
				<input type="hidden" id="school_id" value="1"> <input
					type="hidden" id="user_school_id" value="1">
				<!--<button type="button" class="form-submit" onclick="pre_release();">马上发布</button>-->
				<input type="submit" class="form-submit" value="马上发布" />
			</div>
		</div>
	</form>

	<script src="<%=basePath%>js/jquery-1.11.2.min.js"></script>
	<script src="<%=basePath%>js/add.js"></script>
	<script src="<%=basePath%>js/release.js"></script>
	<script src="<%=basePath%>js/plupload.full.min.js"></script>
</body>
</html>
